FROM php:8.0-fpm
COPY composer.phar /usr/local/bin/composer
RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libzip-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd \
    && docker-php-ext-install zip \
    && docker-php-ext-install bcmath \
    && docker-php-ext-install mysqli

RUN pecl install redis && docker-php-ext-enable redis

RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

WORKDIR /usr/share/nginx/html